//
//  MyRunTableViewCell.m
//  享动
//
//  Created by darker on 16/4/19.
//  Copyright © 2016年 HHUI. All rights reserved.
//

#import "MyRunTableViewCell.h"
#import <UIView+WebCacheOperation.h>

@interface MyRunTableViewCell ()

@property (nonatomic, strong) UIImageView *myImageView;

@property (nonatomic, strong) UILabel *title;

@end

@implementation MyRunTableViewCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        _myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KWIDTH, 150)];
        
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KWIDTH, 150)];
        view.alpha = 0.4;
        view.backgroundColor = [UIColor blackColor];
        
        _title = [[UILabel alloc] initWithFrame:CGRectMake(KWIDTH / 2 - 75, 50, 150, 50)];
        _title.font = [UIFont systemFontOfSize:15];
        _title.textAlignment = NSTextAlignmentCenter;
        _title.textColor = [UIColor whiteColor];
        [self.contentView addSubview:_myImageView];
        [self.contentView addSubview:view];
        [self.contentView addSubview:_title];

        
    }
    return self;
}

- (void) setCellByModel:(MyRunModel *) model
{
    [_myImageView sd_setImageWithURL:[NSURL URLWithString:model.thumb_2]];
    _title.text = model.title;
}

- (void) setCEllByMyRun:(MyRun *)model
{
    [_myImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
    _title.text = model.name;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
